<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@taglib prefix="rich" uri="http://richfaces.org/rich" %>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j" %>

<html>
    <head>

        <script type="text/javascript" language="javascript" src="../scripts/jQuery/confirm.js"></script>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/jquery.fancybox-1.3.4.pack.js"></script>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/jq.date.js"></script>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/easypaginate.js"></script>
        <link rel="stylesheet" type="text/css" href="../css/ui.datepicker.css"/>
        <link rel="stylesheet" type="text/css" href="../css/paging.css"/>

        <link rel="stylesheet" type="text/css" href="../css/thickbox.css"/>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/thickbox.js"></script>


        <script type="text/javascript" language="javascript">
            var open_cur = 0;
            $j = jQuery.noConflict();
            $j(document).ready(function(){


                initThickBox('.thickbox');
                $j('input#leavedate1').datepicker({ dateFormat: 'dd/mm/yy', showOn: 'button', buttonImage: '../images/calenda_icon.gif', buttonImageOnly: true });
                $j('input#dateStart').datepicker({ dateFormat: 'dd/mm/yy', showOn: 'button', buttonImage: '../images/calenda_icon.gif', buttonImageOnly: true });
                $j('input#dateEnd').datepicker({ dateFormat: 'dd/mm/yy', showOn: 'button', buttonImage: '../images/calenda_icon.gif', buttonImageOnly: true });
                   
                $j('.keysearch').live('keyup',function(){
                    if($j('.keysearch').val() == ""){
                        $j('.rich-table-row').show();
                                   
                    }else{
                        $j('.rich-table-row').hide();
                        $j('.rich-table-row').each(function(){
                            html = $j(this).html();
                            if(   ununicode(html).indexOf(  ununicode($j('.keysearch').val()) ) > -1    )  {
                                $j(this).show();
                            }else{
                                $j(this).hide();
                            }
                        });
                    }

                });
   
                // $j(".rich-table-row:odd").addClass("odd");
                $j('.search_box').hide();       
                $j('.sidebar_search').live('click',function(){
                    $j('.search_box').hide();
                    if($j(this).next().hasClass('active')){

                        $j('.search_box').removeClass('active');
                    }else{

                        $j('.search_box').removeClass('active');
                        $j(this).next().addClass('active');
                        $j(this).next().show();
                    }
                });
                $j(".content_right").live("click",function(){
                    $j('.search_box').hide();
                });
                
                $j(".upWeb").live("click",function(){
                    FV050 = $j(this).attr("lang");
                    FS400 = $j(this).children().attr("lang");

                    $j.post("actionupTouronWeb.jsp?action=checkupweb&FV050="+ FV050,function(data){
                        if(data!=null){
                            window.location= "codeproductTour.jsp?action=detailTour&FS400="+FS400; 
                        }
                    });
                });
                
            });
           
        </script>
        <style type="text/css">


            #fancybox-wrap{

            }
            .fields_input{
                float: left;
                margin-top:4px;
                width: 100%;
            }
            .button-link{
                border:0;
                background:url(../images/bg_submit.gif) repeat-x;
                width:134px;
                float:right;
                margin:19px 0 10px 0;
                color:#ffffff;
                font-size:14px;
                font-weight:bold;
                cursor:pointer;
                border-radius:5px;
                box-shadow:0 2px 3px #666666;
                padding:8px 0;
                text-transform:uppercase;
            }
            .customer-box{
                float:left; width:604px; margin-left:25px;
                border:1px solid #CCCCCC;
                padding:18px 0px 10px 0px;
                background: #E5E8EA;
                border-top: none;

            }
            .customer-box label{
                width:90px;
                text-align: right;
                float:left;
            }
            input{
                float:left;
                margin-left:9px;
            }
            select{
                float:left;
                height: 21px;
                width:166px;
                margin-left:9px;
            }
            .ui-datepicker-header select{
                width:45% !important;
            }
            .header-box{
                margin-left:25px;
                color:#263340;
                margin-top:10px;
                float: left;
                cursor:pointer;
                padding:4px 0px 0px 4px; 
                width:600px;
                border:1px solid #CCCCCC;
                font-size:12px;
                background: #D4D7D8;
                height: 21px;
                font-weight: bold;
            }
            .fixdate .ui-datepicker-trigger  { margin-left: 4px;}

            .boder-bomttom{

            }

            .mail_sms{
                float: right;
                margin-right: -19px;
                margin-top: 5px;
            }
            .rich-table-cell{
                height: 45px;
                border-bottom: 0px solid #C4C0C9 !important;
                border-right: 0px solid #C4C0C9 !important;
            }
            .mesage{
                color: red;
                float: left;
                margin-left: 252px;
                margin-top: 20px;
                text-transform: uppercase;

            }
            .rich-table-subheadercell{
                background: none repeat scroll 0 0 #4884B5;
                height: 37px;
                border-right: 0px solid #C4C0C9 !important;
            }
            .rich-table-subheadercell div{
                color: white !important;
                font-weight: bold;

            }
            .sidebar .search_box .fields_select select, .content_detail .list_item_user .item_content .fields_input select{
                padding: 0px 0px 0px 0px;
            }
            .to1{
                background-color: white;
            }
            .to2{
                background-color: #EEEEEE;
            }
            .upWeb img{
                width: 15px;
                height: 15px;
                float: left;
                cursor: pointer;
            }
        </style>
    </head>


    <body>
        <a4j:form>

            <div class="fast_search">

                <h:inputText value="" onfocus="if(this.value=='')this.value='';" styleClass="keysearch" />
                <div  style="margin-left:5px; float:left" class="buttonsearch">
                    <!--                    <div class="group cssgroup">
                    <h:selectOneRadio layout="pageDirection" value="" styleClass="feild_sex"  style="margin-left:5px; margin-top:14px; padding:15px; width:195px; height:153px;"   >
                        <f:selectItem itemValue="0" itemLabel="#{locale.all}" />
                        <f:selectItem itemValue="1" itemLabel="#{locale.company}"/>
                        <f:selectItem itemValue="2" itemLabel="#{locale.telephone}"/>
                        <f:selectItem itemValue="3" itemLabel="#{locale.frist_lastname}"/>
                        <f:selectItem itemValue="4" itemLabel="#{locale.person_info}"/>
                        <f:selectItem itemValue="5" itemLabel="#{locale.email}"/>
                        <f:selectItem itemValue="6" itemLabel="#{locale.tour}"/>

                    </h:selectOneRadio>
                    <h:commandButton      actionListener="#{SPDetailBean.reloadCombobox}" value="#{locale.search}" style="margin-left:75px; margin-top:5px;" styleClass="buttonsearch2">
                    </h:commandButton>
                </div>-->
                </div>



            </div>

        </a4j:form>
        <a4j:form>
            <f:loadBundle basename="#{environmentSession.localizationSource}" var="locale"/>
            <h:outputText value="<div class='permission' lang='#{loginSession.right.TOU_TOUR_CAL}'></div>" escape="false"/>
            <div id="content">
                <div id="menu_top">
                    <div class="dropdown">
                        <div class="select_choise">
                            <a href="#"><span>Khu vực</span></a>
                        </div>
                        <div class="select_hidden">
                            <ul>

                                <li><a href="#"><span>Filter Cấp 3</span></a></li>
                                <li><a href="#"><span>Filter Cấp 3</span></a></li>
                            </ul>
                        </div>
                    </div>
                    <div class="dropdown">
                        <div class="select_choise">
                            <a href="#"><span>Outlets</span></a>
                        </div>
                        <div class="select_hidden">
                            <ul>
                                <li><a href="#"><span>Ban Điều Hành</span></a></li>
                                <li><a href="#"><span>Nhóm IT</span></a></li>
                                <li><a href="#"><span>Filter Cấp 3</span></a></li>
                            </ul>
                        </div>
                    </div>
                </div>
                <div id="content_detail">

                    <!-- end text search-->
                    <!-- start sidebar sidebar_row1--->


                    <!-- start sidebar row2--->
                    <h:panelGroup rendered="#{loginSession.right.DAB_LST_STI}">
                        <div class="sidebar_row2">
                            <div class="sidebar">

                                <div class="sidebar_search">
                                    <span> <h:outputText value="#{locale.search}"/></span>
                                </div>
                                <div class="search_box" style="display:none;">

                                    <h4><h:outputText value="#{locale.advance_search}"/></h4>
                                    <div class="fields_select">
                                        <select name="">
                                            <option><h:outputText value="Nơi khởi hành"/></option>
                                        </select>
                                    </div>
                                    <div class="fields_select">
                                        <select name="">
                                            <option><h:outputText value="Nơi đến"/>...</option>
                                        </select>
                                    </div>
                                    <div class="fields_select">
                                        <select name="">
                                            <option><h:outputText value="Giá"/>...</option>(VND)
                                        </select>
                                    </div>
                                    <div class="fields_select">

                                        <select style="float: left;width: 56px;" name="">
                                            <option><h:outputText value="Ngày"/></option>
                                        </select>
                                        <select style="float: left;width: 60px;" name="">
                                            <option><h:outputText value="Tháng"/></option>
                                        </select>
                                        <select style="float: left;width: 56px;" name="">
                                            <option><h:outputText value="Năm"/></option>
                                        </select>
                                    </div>
                                    <div class="fields_submit">
                                        <input name="" type="submit" value="<h:outputText value="#{locale.search_option}"/>" />
                                    </div>
                                </div>

                            </div>
                        </div>
                    </h:panelGroup>
                    <%--    <div class="fillter">
                          <div class="dropdown">


                            <div class="select_choise ">

                                <a href="#"><span><h:outputText value="Lịch tổ chức Tour"/></span></a>


                            </div>
                            <div class="select_hidden">
                                <ul>

                                    <h:panelGroup rendered="#{loginSession.right.TOU_LST_SERV}">
                                        <li>
                                            <div><a href="createProduct.jsp?linkhref=<h:outputText value="#{kapiMenu.md5url}"/>"><span><h:outputText value="Tổ chức Tour"/></span></a></div>

                                        </li>
                                    </h:panelGroup>
                                    


                                </ul>
                            </div>

                        </div>
</div> --%>

                    <div class="content_right" style="">

                        <div class="content"><h:inputHidden value="#{SPDetailBean.FS400}"/>
                            <div style="height: 29px;background-color: #4A5763;width: 100%;line-height: 29px;">
                                <div style="margin-left: 15px;color: white;">
                                    <h:outputText value="Lịch tổ chức Tour" style="float:left;text-transform:uppercase"/>
                                    <h:selectOneMenu  style="floaf:left;width:231px;margin-top:4px;"  value="#{SPDetailBean.FS400}">
                                        <f:selectItems value="#{SPDetailBean.listS400Combo}"/>
                                        <a4j:support event="onchange" actionListener="#{SPDetailBean.reloadCombobox}"/>
                                    </h:selectOneMenu>
                                    <div style="margin-top: -10px;float: right;text-transform:uppercase;margin-right: 0px;"><a style="color:white;" href="createProduct.jsp?linkhref=<h:outputText value="#{kapiMenu.md5url}"/>"><span><h:graphicImage value="../images/left_grey.png" width="40px;" height="50px;" alt="Quay lại" title="Quay lại" /></span></a></div>
                                </div>

                            </div>
                            <div style="width: 100%; overflow-x: scroll;overflow-y: auto;">
                                <rich:dataTable value="#{SPDetailBean.listS400}" var="cus" rowClasses="to1,to2"

                                                width="926px" columnClasses=",columns,columns,columns" rowKeyVar="row"
                                                id="table3" styleClass="machinePosDataTable">

                                    <rich:column style="width:20px; text-align:center">
                                        <f:facet name="header">
                                            <h:outputText value="STT" />
                                        </f:facet>
                                        <h:outputText value="#{row+1}" />
                                    </rich:column>
                                    <rich:column  style="width:60px;">
                                        <f:facet name="header">
                                            <h:outputText value="Action" />
                                        </f:facet>
                                        <div style="width:60px;text-align: center">
                                            <h:panelGroup rendered="#{cus.vv051 != ''}">

                                                <div class="upWeb" lang=" <h:outputText value="#{cus.fv050}" />"> <img lang="<h:outputText value="#{cus.fs400}" />" src="../images/www.png" alt="Up wed"  title="Up wed" /></div>
                                                </h:panelGroup>
                                                <h:panelGroup rendered="#{loginSession.right.TOU_CAL_DEL}">

                                                <h:outputLink  rendered="#{cus.vv051 != ''}" value="delete.jsp?id=#{cus.fv050}&id2=#{cus.fs400}&flag=V050FF&width=300&height=150" styleClass="fancybox">
                                                    <img src="../images/delete_1.png" alt="delete"  title="delete" />
                                                </h:outputLink>
                                            </h:panelGroup>
                                            <h:panelGroup rendered="#{loginSession.right.TOU_CAL_MOD}">
                                                <h:outputLink rendered="#{cus.vv051!=''}" style="color:white"   value="editcodeproductTour.jsp?action=editV050&FV050=#{cus.fv050}&FS400=#{cus.fs400}&height=5px&width=600px" styleClass="fancybox add_new" id="fancybox34"  >

                                                    <img src="../images/edit.png" alt="edit" title="edit"/>
                                                </h:outputLink>
                                            </h:panelGroup>
                                            <h:panelGroup rendered="#{loginSession.right.TOU_CAL_CRE}">
                                                <h:outputLink rendered="#{cus.vv051==''}" value="acceptcodeProductTour.jsp?action=addV050forTour&FS400=#{cus.fs400}&FA000F=#{cus.fa000f}&FA000T=#{cus.fa000t}&inout=#{cus.sn409}&title=#{cus.sv401}&SN408=#{cus.sn408}&SN406=#{cus.sn406}&price=#{cus.sn404}&from=#{cus.kh}&to=#{cus.dd}&datefrom=#{cus.startdate}&dateto=#{cus.backdate}&h1=#{cus.sn102}&h2=#{cus.sn103}&h3=#{cus.sn108}&h4=#{cus.sn109}&width=300&height=150" styleClass="fancybox"  >

                                                    <img src="../images/things.png" alt="Mở Tour" title="Mở Tour"/>
                                                </h:outputLink>
                                            </h:panelGroup>
                                        </div>

                                    </rich:column>
                                    <rich:column style="width:90px;">
                                        <f:facet name="header">
                                            <h:outputText value="Mã Tour" />
                                        </f:facet>
                                        <div style="width:90px;text-align: center;color: red;font-weight: bold;font-style: italic" >
                                             <h:outputLink value="listTour.jsp?action=linkrecord&fv050=#{cus.fv050}&tabel=T">
                                                    <h:outputText value="#{cus.vv051}" />
                                                </h:outputLink>
                                           

                                        </div>
                                    </rich:column>
                                    <rich:column style="width:200px;">
                                        <f:facet name="header">
                                            <h:outputText value="Sản phẩm Tour" />
                                        </f:facet>
                                        <div style="width:200px;text-align: center;color: red;font-weight: bold;font-style: italic" >

                                            <h:panelGroup rendered="#{loginSession.right.TOU_CAL_PRO}"> <a href="productTour.jsp?action=detailTour&FS400=<h:outputText value="#{cus.fs400}" />">  <h:outputText value="#{cus.sv401}" title="Nhấn vào đây thêm sản phẩm Tour này" /></a></h:panelGroup>

                                            </div>
                                    </rich:column>
                                    <rich:column style="width:90px;">
                                        <f:facet name="header">
                                            <h:outputText value="Quốc Gia" />
                                        </f:facet>
                                        <div style="width:90px;text-align: center">
                                            <h:outputText value="#{cus.dd}" />
                                        </div>
                                    </rich:column>
                                    <rich:column style="width:80px;">
                                        <f:facet name="header">
                                            <h:outputText value="Giá" />
                                        </f:facet>
                                        <div style="width:80px;text-align: center;color: red;font-weight: bold;">
                                            <h:outputText value="#{cus.price}" />
                                        </div>
                                    </rich:column>
                                    <rich:column style="width:30px;">
                                        <f:facet name="header">
                                            <h:outputText value="Số người" />
                                        </f:facet>
                                        <div style="width:30px;text-align: center;color: red;font-weight: bold;">
                                            <h:outputText value="#{cus.sn408}" />
                                        </div>
                                    </rich:column>

                                    <rich:column  width="30px" >
                                        <f:facet name="header">
                                            <h:outputText value="Số ngày" />
                                        </f:facet>

                                        <div style="width:30px;text-align: center">

                                            <h:outputText value="#{cus.sn406}" />
                                        </div>
                                    </rich:column>
                                    <rich:column  width="80px">
                                        <f:facet name="header">
                                            <h:outputText value="Chuyến bay" />
                                        </f:facet>

                                        <div style="width:80px;text-align: center">
                                            <h:outputText value="#{cus.sv110}" />

                                        </div>
                                    </rich:column>

                                    <rich:column  width="60px">
                                        <f:facet name="header">
                                            <h:outputText value="Ngày đi" />
                                        </f:facet>

                                        <div style="width:60px;text-align: center">
                                            <h:outputText value="#{cus.startdate}"><f:convertDateTime pattern="dd/MM/yyyy"/></h:outputText>
                                            </div>
                                    </rich:column>


                                    <rich:column  style="width:40px">
                                        <f:facet name="header">
                                            <h:outputText value="Ngày về" />
                                        </f:facet>
                                        <div style="width:60px;text-align: center">
                                            <h:outputText value="#{cus.backdate}"><f:convertDateTime pattern="dd/MM/yyyy"/></h:outputText>
                                            </div>

                                    </rich:column>
                                    <rich:column  style="width:20px">
                                        <f:facet name="header">
                                            <h:outputText value="Giờ bay" />
                                        </f:facet>
                                        <div style="width:35px;text-align: center">
                                            <h:outputText rendered="#{cus.sn102 < 10}" value="0" /><h:outputText value="#{cus.sn102}:#{cus.sn103}" />
                                        </div>

                                    </rich:column>
                                    <rich:column  style="width:20px">
                                        <f:facet name="header">
                                            <h:outputText value="Giờ đến" />
                                        </f:facet>
                                        <div style="width:35px;text-align: center">
                                            <h:outputText rendered="#{cus.sn108 < 10}" value="0" /><h:outputText value="#{cus.sn108}:#{cus.sn109}" />
                                        </div>

                                    </rich:column>







                                </rich:dataTable>
                            </div>





                        </div>
                    </div>
                </div>
            </div>
        </a4j:form>
    </body>
</html>
